import 'dart:math';

import 'package:flutter/material.dart';

class MyColours {
  static const Color appMain = Color(0xFF3DC694);
  static const Color darkAppMain = Color(0xFF3F7AE0);

  static const Color textGray = Color(0xFFB6B5B5);
  static const Color textGrayA = Color(0xFFB0B0B0);
  static const Color colorA2A2A2 = Color(0xFFA2A2A2);

  static const Color textBlack = Colors.black;

  static const Color line = Color(0xFFF2F2F2);
  
  static const Color bgColor = Color(0xFFF6F6F6);


  static const Color darkBgColor = Color(0xFF18191A);

  static const Color materialBg = Color(0xFFFFFFFF);
  static const Color darkMaterialBg = Color(0xFF303233);

  static const Color text = Color(0xFF333333);
  static const Color darkText = Color(0xFFB8B8B8);

  static const Color darkButtonText = Color(0xFFF2F2F2);

  static const Color darkBgGray = Color(0xFF1F1F1F);

  static const Color darkLine = Color(0xFF3A3C3D);

  static const Color orange = Color(0xFFFF8547);
  static const Color eff2fc = Color(0xFFEFF2FC);
  static const Color ff0060ff = Color(0xFF0060FF);
  static const Color ff269E72 = Color(0xFF269E72);
  static const Color color3DC694 = Color(0x663DC694);
  static const Color color848484 = Color(0xFF848484);
  static const Color colorBFBFBF = Color(0xFFBFBFBF);
  static const Color color0D141B = Color(0x0D0D141B);
  static const Color color888888 = Color(0xFF888888);
  static const Color color2E2626 = Color(0x0D2E2626);
  static const Color colorFF4414 = Color(0xFFFF4414);
  static const Color color676767 = Color(0xFF676767);
  static const Color colorE1E1E1 = Color(0xFFE1E1E1);
  static const Color color9B9B9B = Color(0xFF9B9B9B);
  static const Color color999999 = Color(0xFF999999);
  static const Color color4F4B46 = Color(0xFF4F4B46);
  static const Color colorE33432 = Color(0xFFE33432);
  static const Color colorF0D3BB = Color(0xFFF0D3BB);

  static const Color color73736EB = Color(0xFF73736E);

  static const Color colorE7C8A6 = Color(0xFFE7C8A6);

  static const Color color8E6447 = Color(0xFF8E6447);

  static const Color colorD3D3D3 = Color(0xFFD3D3D3);

  static const Color color242221 = Color(0xFF242221);

  static const Color colorDFDFDF = Color(0xFFDFDFDF);

  static const Color color752C06 = Color(0xFF752C06);

  static const Color colorF6F6F6 = Color(0xFFF6F6F6);

  /// 随机颜色
  ///
  static Color randomRGB() {
    return Color.fromARGB(255, Random().nextInt(255), Random().nextInt(255), Random().nextInt(255));
  }

  static Color randomARGB() {
    Random random = Random();
    return Color.fromARGB(random.nextInt(180), random.nextInt(255), random.nextInt(255), random.nextInt(255));
  }

  /// String is in the format "aabbcc" or "ffaabbcc" with an optional leading "#".
  static Color fromHex(String hexString) {
    final buffer = StringBuffer();
    if (hexString.length == 6 || hexString.length == 7) buffer.write('ff');
    buffer.write(hexString.replaceFirst('#', ''));
    return Color(int.parse(buffer.toString(), radix: 16));
  }
}
